﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Smart
{
    public class DbCariBakiye : Tablo
    {
        public int Id { get; set; }
        public decimal GenelBakiye { get; set; }
        public decimal Bakiye1 { get; set; }
        public decimal Bakiye2 { get; set; }
        public decimal Bakiye3 { get; set; }
        public decimal Bakiye4 { get; set; }
        public decimal Bakiye5 { get; set; }
        public decimal Bakiye6 { get; set; }
        public decimal Bakiye7 { get; set; }
        public decimal Bakiye8 { get; set; }
        public decimal Bakiye9 { get; set; }
        public decimal Bakiye10 { get; set; }

        public DbCariBakiye()
        {
            this.TabloAdi = "TBL_CARIBAKIYE";
        }

        public override IEnumerable<string> BulkImport()
        {
            string[] srmList = new string[10];
            for (int i = 0; i < srmList.Length; i++)
            {
                srmList[i] = string.Empty;
            }
            int x = 0;
            foreach (string item in BackOffice.Get.SrmList())
            {
                srmList[x] = item.Split('Æ')[1];
                x++;
            }

            yield return "İndiriliyor...";
            string[] dt = BackOffice.Get.CariBakiyeList(new DateTime(1900, 1, 1), srmList);
            yield return "indirildi.";
            foreach (string item in SqlCeClient.Get.importRows(this.TabloAdi, dt))
            {
                yield return item;
            }
            yield return "Tamamlandı";
        }
    }
}
